import 'package:flutter/material.dart';

import 'package:flutter_todolist/widgets/app_bars.dart';
import '../home/bottomNavigation.dart';
import 'fab.dart';
import '../../util.dart';

class Empty extends StatefulWidget {
  Empty({Key? key}) : super(key: key);

  _EmptyState createState() => _EmptyState();
}

class _EmptyState extends State<Empty> {
  var bottomNavigationBarIndex = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: emptyAppbar(),
      body: Column(
        children: [
          // appBar(),
          Expanded(
            flex: 8,
            child: Hero(
              tag: 'Clipboard',
              child: Image.asset('assets/images/Clipboard-empty.png'),
            ),
          ),
          Expanded(
            flex: 3,
            child: Column(
              children: const <Widget>[
                Text(
                  'No tasks',
                  style: TextStyle(
                      fontSize: 22,
                      fontWeight: FontWeight.w500,
                      color: CustomColors.TextHeader),
                ),
                SizedBox(height: 15),
                Text(
                  'You have no tasks to do.',
                  style: TextStyle(
                      fontSize: 17,
                      fontWeight: FontWeight.w400,
                      color: CustomColors.TextBody,
                      fontFamily: 'opensans'),
                  textAlign: TextAlign.center,
                ),
              ],
            ),
          ),
          Expanded(
            flex: 1,
            child: Container(),
          )
        ],
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
      floatingActionButton: customFab(context),
      bottomNavigationBar: BottomNavigationBarApp(context, bottomNavigationBarIndex, (index) {}),
    );
  }

  Widget appBar() {
    return Stack(
      children: [
        Container(
          height: 75,
          decoration: const BoxDecoration(
              gradient: LinearGradient(
                begin: Alignment.topLeft,
                end: Alignment.bottomRight,
                colors: [CustomColors.HeaderBlueDark, CustomColors.HeaderBlueLight],
              )
          ),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              CustomPaint(
                painter: CircleOne(),
              ),
              CustomPaint(
                painter: CircleTwo(),
              ),
            ],
          ),
        ),
        Positioned(
            left: 0,
            right: 0,
            top: 0,
            bottom: 0,
            child: Container(
              margin: EdgeInsets.only(top: 20),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: const <Widget>[
                  Text(
                    'Hello Brenda!',
                    style: TextStyle(fontSize: 15, fontWeight: FontWeight.w600, color: Colors.white),
                  ),
                  Text(
                    'Today you have no tasks',
                    style: TextStyle(fontSize: 10, fontWeight: FontWeight.w300, color: Colors.white),
                  ),
                ],
              ),
            )
        ),
        // Positioned(
        //   child: child
        // )
      ],
    );
  }
}
